<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/WEB-INF/faces/template.xhtml">
        <ui:define name="title">
            <h:outputText value="Edit Truck"></h:outputText>
        </ui:define>
        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <p:growl sticky="true"/>
            </h:panelGroup>
            <p:panel header="Edit Truck" style="border: none;">
                <h:form>
                    <h:panelGrid id="entryPanel" columns="3">
                        <h:outputLabel value="Lorry Number" for="lorryNumber" />
                        <h:inputText id="lorryNumber" value="#{truckBean.selected.lorryNumber}" requiredMessage="Required" required="true"/>
                        <p:message for="lorryNumber" />
                        <h:outputLabel value="Engine Number" for="engineNumber" />
                        <h:inputText id="engineNumber" value="#{truckBean.selected.engineNumber}" requiredMessage="Required" required="true"/>
                        <p:message for="engineNumber" />
                        <h:outputLabel value="Chesis Number" for="chesisNumber" />
                        <h:inputText id="chesisNumber" value="#{truckBean.selected.chesisNumber}" requiredMessage="Required" required="true"/>
                        <p:message for="lorryNumber" />
                        <h:outputLabel value="Owner Name" for="ownerName" />
                        <h:inputText id="ownerName" value="#{truckBean.selected.ownerName}" requiredMessage="* Required" required="true"/>
                        <p:message for="ownerName" />
                        <h:outputLabel value="Owner Address" for="ownerAddress" />
                        <h:inputText id="ownerAddress" value="#{truckBean.selected.ownerAddress}" requiredMessage="* Required" required="true"/>
                        <p:message for="ownerAddress" />
                        <h:outputLabel value="Owner Contact Number" for="ownerContactNumber" />
                        <h:inputText id="ownerContactNumber" value="#{truckBean.selected.ownerContactNumber}" requiredMessage="* Required" required="true"/>
                        <p:message for="ownerContactNumber" />
                        <h:outputLabel value="Weight Bear" for="weightBear" />
                        <h:inputText id="weightBear" value="#{truckBean.selected.weightBear}" requiredMessage="* Required" required="true"/>
                        <p:message for="weightBear" />
                        <h:outputLabel value="Volume" for="volume" />
                        <h:inputText id="volume" value="#{truckBean.selected.volume}" requiredMessage="* Required" required="false"/>
                        <p:message for="volume" />

                    </h:panelGrid>
                    <br/>
                    <p:commandButton action="#{truckBean.update}" value="Save" update="entryPanel"/>

                    <p:commandButton action="pretty:listTrucks" value="Cancel" immediate="true"/>

                </h:form>
            </p:panel>


        </ui:define>
    </ui:composition>

</html>
